package com.kuhnwei.examples.patterns.proxy;

/**
 * Created by Kuhn on 2017/8/5.
 */
public class ProxySubject implements Subject {

    private Subject subject;
    public ProxySubject(Subject subject) {
        this.subject = subject;
    }

    public void prepare() {
        System.out.println("[吃饭前的准备]：买菜、洗菜、做饭、炒菜......");
    }

    public void destroy() {
        System.out.println("[吃完饭的收尾]：收钱、收拾餐桌......");
    }

    public void get() {
        this.prepare();
        this.subject.get();
        this.destroy();
    }
}
